const express = require('express')
const {
  Random
} = require('mockjs')
const router = express.Router()
/**
 * @Description 获取订单进度列表
 * @author 孙畅
 * @date 2020-11-06
 * @param {any} '/progress'
 * @param {any} req
 * @param {any} res
 * @returns {any}
 */
router.get('/progress', function (req, res) {
  var data = {
    status: 200,
    message: 'success',
    data: []
  }
  // 待开裁
  var wattingCut = {
    state: '待开裁',
    total: Random.integer(10, 20),
    groupBuy: Random.integer(5, 10),
    list: []
  }
  var cutting = {
    state: '开裁中',
    total: Random.integer(10, 20),
    groupBuy: Random.integer(5, 10),
    list: []
  }
  for (var i = 0; i < 10; i++) {
    wattingCut.list.push({
      id: i + 1
    })
    cutting.list.push({
      id: i + 1
    })
  }
  data.data.push(wattingCut)
  data.data.push(cutting)
  
  res.send(data)
})
module.exports = router